<?php
if(!defined('CMS'))die;
global$Eleanor;
$Eleanor->mconfig=include($Eleanor->module['path'] .'config.php');
Eleanor::LoadOptions($Eleanor->mconfig['opts']);
$ev=isset($_POST['event']) ? (string)$_POST['event'] : '';
switch($ev) {
	case'delete_file':
		$image = str_replace('_preview', null, Eleanor::$rootf . $_POST['file_name']);
		if (file_exists($image) && file_exists(Eleanor::$rootf . $_POST['file_name'])) {
			unlink(Eleanor::$rootf . $_POST['file_name']);
			unlink($image);
			Result(true);
		}
	break;
	default:
		Error(Eleanor::$Language['main']['unknown_func']);
}